﻿
using System;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration;
using Abp.Application.Services.Dto;
using Abp.Extensions;
using KDS.Mes.Mes.Styles;

namespace KDS.Mes.Mes.Styles.EntityMapper.Styles
{

	/// <summary>
    /// 款式信息的数据配置文件
    /// </summary>
    public class StyleCfg : EntityTypeConfiguration<Style>
    {
		/// <summary>
        ///  构造方法[默认链接字符串< see cref = "MesDbContext" /> ]
        /// </summary>
		public StyleCfg ()
		{
		            ToTable("Style", MesConsts.SchemaName.Basic);
 
      //todo: 需要将以下文件注入到MesDbContext中

  //		public IDbSet<Style> Styles { get; set; }
   //		 modelBuilder.Configurations.Add(new StyleCfg());




		    //  - 关系映射
			HasRequired(a => a.Cartype).WithMany().HasForeignKey(c => c.CartypeId).WillCascadeOnDelete(true);


		    // 款式名称
			Property(a => a.StyleName).HasMaxLength(20);
		}
    }
}